/*
 * PuyoSettings.java
 *
 * Created on 2006.11.04, PM 10:17
 *
 * Define some dimensions of the game board.  
 */

package Puyo;
import javax.microedition.lcdui.Displayable;
/**
 *
 * @author Ming Li
 */
public class PuyoSettings {
     /**puyo board width */
  public static final int boardWidth=6;  
  /**puyo board height*/
  public static final int boardHeight=12;
  
  /** puyo balls size: width*/
  public static int ballWidth = 32;
  /** puyo balls size: height*/
  public static int ballHeight = 32;
  
  /** puyo canvas size: width*/
  public static int canvasWidth; 
  /** puyo camvas size: height*/
  public static int canvasHeight; 
  
  public static void init(Displayable displayable){
    
    canvasWidth = displayable.getWidth ();
    canvasHeight = displayable.getHeight();
    ballWidth = canvasWidth / boardWidth;
    ballHeight = canvasHeight /boardHeight;
    int minSize  = Math.min(ballWidth, ballHeight);
    ballWidth = ballHeight = minSize;
  }
  public static int boardHeightInPixel()
  {
      return ballHeight * boardHeight;
  }
  
  public static int boardWidthInPixel()
  {
      return ballWidth * boardWidth;
  }
    
  public static int floorThickness()
  {
      return canvasHeight - boardHeightInPixel() ;
  }
}
